BUILDLOG = $(OBJDIR)\build.log

INCS = -I.

SRCS = win_syslog.c \
	win_compat.c \
	buf.c \
	category.c \
	category_table.c \
	conf.c \
	event.c \
	format.c \
	level.c \
	level_list.c \
	mdc.c \
	record.c \
	record_table.c \
	rotater.c \
	rule.c \
	spec.c \
	thread.c \
	thread_list.c \
	zc_arraylist.c \
	zc_hashtable.c \
	zc_profile.c \
	zc_util.c \
	zlog.c \
	release.c
	
OBJS = $(SRCS:.c=.o)

MACROS = _MSC_VER=1500
CFLAGS = -O2

all:pre mak

pre:
	@ if not exist $(strip $(OBJDIR)) \
		@ mkdir $(strip $(OBJDIR)) 
	@ if exist $(strip $(BUILDLOG)) \
		@ del /f  $(strip $(BUILDLOG))

mak:$(OBJS)

$(OBJS):
	@ echo cc $(patsubst %.o,%.c,$@)
	@ $(CC) -D $(MACROS) $(CFLAGS) -c $(INCS) -o $(OBJDIR)\$@ $(patsubst %.o,%.c,$@) 2>$(BUILDLOG)